home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / comm / prtcs155.zip / PRODCFG.REX < prev    next >
OS/2 REXX Batch file  |  1994-01-14  |  7KB  |  175 lines

  1. /**/
  2. v="$VER: ProdCFG  Rexx  Process FTSC Product Code File   Williamson 54.01"
  3. /* fullpath to FTSC Product Codes List */
  4. fpf='FILE:FTSC/FTSCPROD.048'
  5. /* path of ftsc product codes ARCHIVE */
  6. fdir="MAIL:INBOUND/"
  7. /* work dir */
  8. tdir="RAM:TMP"
  9. /* unarc command */
  10. unarc='RAM:REXX/x.REXX'
  11. /**/
  12.  
  13.     if ~show("L", "rexxsupport.library") then
  14.         if ~addlib("rexxsupport.library", 0, -30, 0) then do
  15.                 say "Couldn't access support.library !"
  16.                 exit 20
  17.         end
  18.     sv='v'||right(v,5);script="ProdCFG"
  19.  
  20.     parse upper arg prodarc
  21.     if prodarc="" then signal usage
  22.     if prodarc~="DO" then do
  23.         call makedir(tdir)
  24.         call Pragma('D',tdir)
  25.         if exists('rpdir:x') then address COMMAND 'X' fdir||prodarc
  26.         else do
  27.             cmd=unarc fdir||prodarc
  28.             address "REXX" cmd
  29.         end
  30.         prodfile=showdir(tdir)
  31.         say 'Processing new Product Codes:'prodarc prodfile
  32.         fpf=tdir'/'prodfile
  33.         call delete('ENVARC:ftsflags.0')
  34.     end
  35.  
  36.     if exists('ENVARC:ftsflags.0') then do
  37.         say "Product flags already configured"
  38.         exit
  39.     end;else do
  40.         say "Configuring product codes"
  41.     end
  42.     envarc=1
  43.  
  44. if ~open('fpc',fpf,'r') then do
  45.     Say 'Unable to find FTSC Product Code List:'fpf;exit 10
  46. end
  47.  
  48. /* Mailer flags for certain mailers     */
  49. /* Product Code     Mailer Flags  */
  50. default     =   "7y,cy,ob,ib,py,sy,bn,ay,nn,wn,fy,my,d0"
  51. flags.0     =   '7n,ot,sy'  /*  Fido MelMail    */
  52. flags.5     =   '7n,ot,sy'  /*  Opus            */
  53. flags.7     =   default     /*  WPL             */
  54. flags.12    =   '7n'        /*  FrontDoor       */
  55. flags.27    =   '7n,sf'     /*  Binkely >2.40   */
  56. flags.51    =   'sn,7n'     /*  Binkley/ST      */
  57. flags.57    =   '7n,ot'     /*  TrapDoor        */
  58. flags.58    =   '7n,by'     /*  WelMat >.46     */
  59. flags.66    =   'sy'        /*  TIMS            */
  60. code=0
  61. mailers=0
  62. dropped=0
  63. do forever
  64.     Line=strip(space(translate(ReadLn('fpc'),"   ",'0a'X||'0d'X||'09'X),1))
  65.     if EOF('fpc') then Leave
  66.     if (Line == "") | (left(Line,1)=';') | (left(Line,1)='0d'x) then iterate
  67.     if index(Line,'DROPPED') ~= 0 then do
  68.         parse var Line p','n .
  69.         Line=p','n||copies(',-NA-',4)
  70.         dropped=dropped+1
  71.     end
  72.     Parse var Line p','n','e','f','c','a .
  73.     code=x2d(p)
  74.     prod.code=p;name.code=n;env.code=e;func.code=f;contact.code=c;address.code=a
  75.     if env.code="-NA-" then flags.code='p'
  76.     if flags.code='flags.'code | flags.code='flags.CODE' then flags.code=default
  77.  
  78.     /* Certain products are flagged as MAILER, when they are not */
  79.     if prod.code ~= 27 & index(upper(func.code),"MAILER") ~= 0 then do
  80.         mailers=mailers+1
  81.         if words(name.code) ~= 1 then name.code = '"'||name.code||'"'
  82.         address COMMAND 'SetEnv' mname.code name.code
  83.         if flags.code ~= default then address COMMAND 'SetEnv ftsflags.'code flags.code
  84.     end
  85. end
  86.  
  87. maxprod=code
  88. say 'Mailers: 'mailers' Dropped: 'dropped' Total Prods:'maxprod
  89. Close('fpc')
  90. if envarc then do
  91.     address COMMAND "COPY ENV:mname.#? ENVARC:"
  92.     address COMMAND "COPY ENV:ftsflags.#? ENVARC:"
  93. end
  94. exit
  95. usage:
  96. say;say ' 'script sv' by Robert Williamson';say
  97. say '   Please make sure the following are correct for your setup:';say
  98. say '        fpf   'fpf
  99. say '                       fullpath to FTSC Product Codes List'
  100. say '       fdir   'fdir
  101. say '                       path of ftsc product codes ARCHIVE, if newer'
  102. say '       tdir   'tdir
  103. say '                       a temporary work dir'
  104. say '      unarc   'unarc
  105. say '                       fullpath to unarc command';say
  106. say '   If these setting are OK, then run the program:'
  107. say '       ProdCFG DO'
  108. say '           or'
  109. say '       ProdCFG productarchivename'
  110. say
  111. exit
  112. /*
  113.  Does not handle different xprfts.library options for different versions of
  114.  a product; this is done in WPL.
  115.  
  116.     options  value              meaning
  117.  
  118.       7       Y                Allow the use of MODEM7 filename exchanging.
  119.       7       N                Don't do anything relating to MODEM7 at all.
  120.  
  121.       P.S. Technically MODEM7 should not be used in DietIFNA, but some sites
  122.            seem to require it.
  123.        
  124.       C       Y                Allow MODEM7 to be skipped on inbound if the
  125.                                remote polls with a 'c'.
  126.       C       N                Do modem7 anyways.
  127.  
  128.       O       T                Only ever generate a Telink header block
  129.       O       S                Only ever generate a SeaLink header block
  130.       O       B                Generate both types of header.
  131.  
  132.       I       T                Accept only Telink header block
  133.       I       S                Accept only SeaLink header block
  134.       I       B                Accept both types of header.
  135.  
  136.       P       Y                Pickup files on outdial.
  137.       P       N                Don't pickup on outdial.
  138.  
  139.       S       Y                Allow the use of FTS7 (SeaLink)
  140.       S       F                Do FTS7 even if not asked for.
  141.       S       N                Don't do FTS7 at all
  142.  
  143.       B       Y                Allow special 'Big Filename' headers to be 
  144.                                  generated
  145.       B       N                Do not generate 'Big filename' headers.
  146.  
  147.       A       Y                Ask for SeaLink by using block/compliment in
  148.                                ACK/NAK's
  149.       A       N                Use only single character ack/nak.
  150.  
  151.       N       Y                Ask for MDM7 by polling with NAK rather than
  152.                                a 'c'.
  153.       N       N                Poll with a 'c'.
  154.  
  155.       W       Y                Wait for Sealink block/compliment on ACK/NAK's
  156.                                NOTE: This will interact VERY badly with Modem7
  157.                                filename transfers, so only use in Sealink
  158.                                transfers.
  159.       W       N                Assume 1 character Xmodem ack/nak
  160.  
  161.       F       Y                Give the first file a header (Telink/SeaLink)
  162.       F       N                Don't give the first file a header.
  163.  
  164.       M       Y                First file is Mail bundle (FTS-1)
  165.       M       N                First file is actual outbound file transfer.
  166.  
  167.       D       #                Debug Level (not yet valid).
  168.  
  169.   example (The current Defaults):
  170.    XprSetup xprfts.library "7y,cy,ob,ib,py,sy,bn,ay,nn,wn,fy,my,d0"
  171.  
  172.   Any option not given an explicit value will get the current defaults.  The
  173.   defaults are set up to be as 'friendly' as possible to as many sites.
  174. */
  175.